package com.shop.front.service.article;

import com.shop.front.vo.article.ArticleInfoVo;
import com.shop.domain.article.Article;
import com.shop.front.dao.article.ArticleSQLDao;
import com.shop.web.response.BaseResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Slf4j
@Transactional
public class ArticleService {


    @Autowired
    private ArticleSQLDao articleSQLDao;


    public Page<Article> pageArticle() {
        Page page = articleSQLDao.pageArticle();
        return page;
    }


    public BaseResponse queryArticleInfo(Long id){
        ArticleInfoVo articleInfoVo = articleSQLDao.queryArticleInfo(id);
        return new BaseResponse(articleInfoVo);
    }

}
